$(function () {
    var addUrl  = '/employ/addEmploy';

    $('#subEmploy').click(function () {
        var employName = $('#employName').val();
        var phone = $('#phone').val();
        var mail = $('#mail').val();
        var idCard = $('#idCard').val();
        var gender = $('#gender').val();
        var salary = $('#salary').val();
        var role = $('#role').val();
        var entryTime = $('#entryTime').val();
        if (employName == '' || phone == '' || mail == '' || idCard == '' ||
            gender == '' || salary == '' || role == '' || entryTime == '') {
            alert('填写的信息不全');
        }else {
            var employ = {};
            var format = new FormData();
            employ.employName = employName;
            employ.phone = phone;
            employ.mail = mail;
            employ.idCard = idCard;
            employ.gender = gender;
            employ.salary = salary;
            employ.role = role;
            employ.entryTime = entryTime;
            employ.status = '1';
            format.append('employStr',JSON.stringify(employ));
            $.ajax({
                url:addUrl,
                type:"POST",
                data:format,
                contentType:false,
                processData:false,
                cache:false,
                success:function (data){
                    alert(data.message);
                    if (data.code==200){
                        //添加成功
                    }
                }
            })
        }
    })


});